import React from "react";
import { useDispatch, useSelector } from "react-redux";
import { increment, decrement } from "../../R/Shop";

//样式
import { Tabs } from "react-vant";

export default function Home() {
  let dispath = useDispatch();
  // 获取状态
  const list = useSelector((state) => state.Shop.value);
  let decrements = (a) => {
    console.log(a);
    dispath(decrement(a));
  };

  const items = [
    "推荐",
    "初步",
    "人工智能",
    "数据分析",
    "推荐",
    "初步",
    "人工智能",
    "数据分析",
  ];
  // console.log(items);

  return (
    <div>
      <div className="demo-tabs">
        <Tabs defaultActive={4} className="Home-tabs">
          {items.map((item) => (
            <Tabs.TabPane key={item.id} title={`${item}`}></Tabs.TabPane>
          ))}
        </Tabs>
      </div>

      <div className="Home-one">
        <div>
          <div className="Home-er">Vue3将成为新的默认版本</div>
          <div>
            <span className="Home-san">顶置</span>
            <span>小冰科技</span>
            <span>999+评论</span>
          </div>
        </div>
        <div>
          <div className="Home-er">居家就医，互联网医院能让你如愿吗</div>
          <div>
            <span className="Home-san">顶置</span>
            <span>极客新闻</span>
            <span>137评论</span>
          </div>
        </div>
        <div>
          <div className="Home-er">谷歌力推新语言Logica,解决SQL重大缺陷！</div>
          <div>
            <span>小兵张嘎</span>
            <span>837评论</span>
          </div>
        </div>
      </div>
      <div className="home_si">
        <div>
          <div className="Home_wu">
            <div>云原生开发者要掌握哪些“真功夫”</div>
           <div>
           
           <img
              src={require("../../Styles/img/7041714656032_.pic.jpg")}
              alt=""
              srcset=""
            />

           
           </div>
          </div>
          <div className="Home_liu">
            <span>圆圆视点</span> <span>35评论</span> <span>1天前</span>
            <button>x</button>
            <span></span>
          </div>
        </div>
      </div>

      <div className="home_si">
        <div>
          <div className="Home_wu">
            <div>用python写了一个上课点名系统</div>
            <img
              src={require("../../Styles/img/94301714720000_.pic.jpg")}
              alt=""
              srcset=""
            />
          </div>
          <div className="Home_liu">
            <span>我是程序员</span> <span>17评论</span> <span>3天前</span>
            <button>x</button>
            <span></span>
          </div>
        </div>
      </div>

      <div className="home_si">
        <div>
          <div className="Home_wu">
            <div>[JavaScript]解析赋值详情</div>
          <div>
          <img
              src={require("../../Styles/img/94321714720446_.pic.jpg")}
              alt=""
              srcset=""
            />
            <img
              src={require("../../Styles/img/94311714720238_.pic.jpg")}
              alt=""
              srcset=""
            />
          </div>
          </div>
          <div className="Home_liu">
            <span>六六6呀</span> <span>88评论</span> <span>2天前</span>
            <button>x</button>
            <span></span>
          </div>
        </div>
      </div>



    </div>
  );
}
